<!--  -->
<template>
  <div class="orderlsit">
    <section class="container-main-header">
      <section class="header-left">
        <i class="el-icon-menu"></i>
        <h3>首页</h3>
        <span class="solidus">/</span>
        <h3>订单</h3>
        <span class="solidus">/</span>
        <span>订单列表</span>
      </section>
      <section class="header-right">
        <i class="el-icon-pear" @click="leaveHandle"></i>
      </section>
    </section>
    <section class="container-main-content">
      <div class="search-filters">
        <div class="search-filters-top">
          <div class="topLeft">
            <i class="el-icon-search"></i>&nbsp;&nbsp;
            <span>筛选搜索</span>
          </div>
          <div class="topRight">
            <el-button style="margin-right:15px;" class="resetBtn">重置</el-button>
            <el-button type="primary" class="searFilBtn">查询搜索</el-button>
          </div>
        </div>
        <div class="search-filters-bottom">
          <div class="input-item">
            <span>输入搜索：</span>
            <el-input
              v-model="input"
              placeholder="订单编号"
              style="width:171px;height242px;margin-right:20px"
            ></el-input>
          </div>
          <div class="input-item">
            <span>收货人：</span>
            <el-input
              v-model="input"
              placeholder="收货人姓名/手机号码"
              style="width:171px;height242px;margin-right:20px"
            ></el-input>
          </div>
          <div class="input-item">
            <span>提交时间：</span>
            <el-date-picker v-model="value1" type="date" placeholder="请选择日期" style="width:171px;"></el-date-picker>
          </div>
          <div class="input-item">
            <span>订单状态：</span>
            <el-select
              v-model="select"
              slot="prepend"
              placeholder="全部"
              style="width:171px;height:24px;margin-right:20px"
            >
              <el-option label="待付款" value="1"></el-option>
              <el-option label="待发货" value="2"></el-option>
              <el-option label="已发货" value="3"></el-option>
              <el-option label="已完成" value="4"></el-option>
              <el-option label="已关闭" value="5"></el-option>
            </el-select>
          </div>
          <div class="input-item">
            <span>订单分类：</span>
            <el-select
              v-model="select"
              slot="prepend"
              placeholder="请选择"
              style="width:171px;height:24px;margin-right:20px"
            >
              <el-option label="正常订单" value="1"></el-option>
              <el-option label="秒杀订单" value="2"></el-option>
            </el-select>
          </div>
          <div class="input-item">
            <span>订单来源：</span>
            <el-select
              v-model="select"
              slot="prepend"
              placeholder="请选择"
              style="width:171px;height:24px;margin-right:20px"
            >
              <el-option label="PC订单" value="1"></el-option>
              <el-option label="APP订单" value="2"></el-option>
            </el-select>
          </div>
        </div>
      </div>
      <div class="dataList">
        <el-row>
          <el-col :span="24">
            <div class="grid-content">
              <i class="el-icon-document"></i>&nbsp;&nbsp;
              <span>数据列表</span>
            </div>
          </el-col>
        </el-row>
      </div>
      <div class="dataListTable">
        <template>
          <el-table
            ref="multipleTable"
            :data="tableData"
            :border="border"
            tooltip-effect="dark"
            style="width: 100%"
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column label="编号" width="120">
              <template slot-scope="scope">{{ scope.row.date }}</template>
            </el-table-column>
            <el-table-column label="订单编号" width="120">
              <template slot-scope="scope">{{ scope.row.date }}</template>
            </el-table-column>
            <el-table-column label="提交时间" width="120">
              <template slot-scope="scope">{{ scope.row.date }}</template>
            </el-table-column>
            <el-table-column label="用户账号" width="120">
              <template slot-scope="scope">{{ scope.row.date }}</template>
            </el-table-column>
            <el-table-column label="订单金额" width="120">
              <template slot-scope="scope">{{ scope.row.date }}</template>
            </el-table-column>
            <el-table-column label="支付方式" width="120">
              <template slot-scope="scope">{{ scope.row.date }}</template>
            </el-table-column>
            <el-table-column prop="name" label="订单来源" width="120"></el-table-column>
            <el-table-column prop="name" label="订单状态" width="120"></el-table-column>
            <el-table-column prop="name" label width="120"></el-table-column>
            <el-table-column prop="name" label="操作"></el-table-column>
          </el-table>
        </template>
      </div>
      <div class="pagination">
        <div class="pagination-left">
          <el-select
            v-model="select"
            slot="prepend"
            placeholder="批量操作"
            style="width:171px;height:24px;margin:0;margin-right:20px;"
          >
            <el-option label="批量发货" value="1"></el-option>
            <el-option label="关闭订单" value="2"></el-option>
            <el-option label="删除订单" value="3"></el-option>
          </el-select>
          <el-button type="primary" class="sureBtn">确定</el-button>
        </div>
        <div class="pagination-right">
          <el-pagination
            background
            :page-sizes="[5, 10, 15,]"
            :page-size="5"
            layout="total, sizes, prev, pager, next, jumper"
            :total="10"
            style="float:right;"
          ></el-pagination>
        </div>
      </div>
    </section>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      select: "",
      input: "",
      value1: "",
      border: true,
      tableData: [
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-08",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-06",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      multipleSelection: [],
      border: true,
    };
  },

  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    toggleSelection(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    leaveHandle() {
      var n = confirm("是否退出登录");
      if (n == true) {
        window.sessionStorage.clear();
        location.reload();
      }
    },
    sizeChange() {},
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style  scoped>
.container-main-header {
  padding: 0 20px;
  align-items: center;
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
}
.header-left {
  display: flex;
  align-items: center;
}
.header-left h3 {
  font-size: 14px;
}
.solidus {
  margin: 0 5px;
}
.el-icon-menu {
  margin-right: 20px;
  font-size: 20px;
  cursor: pointer;
}
.el-icon-pear {
  font-size: 24px;
  cursor: pointer;
}
.container-main-content,
.search-filters {
  padding: 20px;
}
.search-filters {
  width: 100%;
  border: 1px solid #ececec;
}
.search-filters-top {
  display: flex;
  justify-content: space-between;
}
.resetBtn,
.searFilBtn {
  padding: 9px 15px;
  width: 56px;
  height: 32px;
  font-size: 12px;
}
.searFilBtn {
  width: 80px;
  margin: 0;
}
.search-filters-bottom {
  display: flex;
  flex-wrap: wrap;
  padding-right: 100px;
  padding-left: 30px;
}
.input-item {
  width:271px;
  margin: 20px;
}
.el-row {
  margin: 20px 0;
}
.el-col {
  border: 1px solid #ececec;
  height: 60px;
  padding: 20px;
}
.dataListTable {
  margin-bottom: 20px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
}
.sureBtn {
  padding: 9px 15px;
  height: 32px;
  font-size: 12px;
  width: 80px;
  margin: 0;
}
/deep/ td,
/deep/ th {
  text-align: center;
}
</style>